<template>
  <div class="student">
    <h1>学生管理</h1>


    <div class="student-list">
      <el-table :data="student" height="250" stripe  style="width: 100%">
        <!-- 无数据时显示 -->
        <template #empty>
          <el-empty description="暂无数据" />
        </template>

        <el-table-column prop="id" label="学号" width="180" />
        <el-table-column prop="name" label="姓名" width="180" />
        <el-table-column prop="age" label="年龄" />
      </el-table>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import { getStudentList } from '../api/student';


  const student:IStudent[] = ref<IStudent[]>([])
  const getStudentListAction = async () => {
    const res = await getStudentList()
    if (res.code === 200) {
      student.value = res.data
    }
  }

</script>

<style scoped>

</style>
